#ifndef WhiteNoise_H
#define WhiteNoise_H

#include <QWidget>
#include <QComboBox>
#include <QPushButton>
#include <QLabel>
#include <QMediaPlayer>
#include <QMediaPlaylist>

// 白噪音播放器类
class WhiteNoise : public QWidget {
    Q_OBJECT

public:
    explicit WhiteNoise(QWidget *parent = nullptr);
    ~WhiteNoise();

private slots:
    void loadNoise(int index);     // 加载白噪音文件
    void togglePlayback();         // 切换播放与暂停
    void onMediaStatusChanged(QMediaPlayer::MediaStatus status);

private:
    QComboBox *noiseSelector;
    QPushButton *playPauseButton;
    QMediaPlayer *mediaPlayer;
    bool isPlaying;
};

#endif // WhiteNoise_H
